package com.smart.community.property.vo;

import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 水电费统一视图对象
 * @author Wu.Liang
 * @since 2025-06-26
 * @version 1.0.0
 */
@Data
public class UtilityFeeVO {

    private Long id;

    private Long userId;

    private String userName;

    private Long communityId;

    private String communityName;

    private Long householdId;

    private String householdInfo;

    /**
     * 费用类型：1-水费，2-电费
     */
    private Integer feeType;

    /**
     * 费用类型名称
     */
    private String feeTypeName;

    private String billingPeriod;

    private BigDecimal previousReading;

    private BigDecimal currentReading;

    private BigDecimal usageAmount;

    private BigDecimal unitPrice;

    private BigDecimal amount;

    private LocalDate dueDate;

    private Integer paymentStatus;

    private BigDecimal paymentAmount;

    private LocalDateTime paymentTime;

    private String paymentMethod;

    private LocalDate readingDate;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    /**
     * 获取费用类型名称
     */
    public String getFeeTypeName() {
        if (feeType == null) {
            return "未知";
        }
        switch (feeType) {
            case 1:
                return "水费";
            case 2:
                return "电费";
            default:
                return "未知";
        }
    }

    /**
     * 获取支付状态名称
     */
    public String getPaymentStatusName() {
        if (paymentStatus == null) {
            return "未知";
        }
        switch (paymentStatus) {
            case 0:
                return "未支付";
            case 1:
                return "已支付";
            case 2:
                return "逾期";
            default:
                return "未知";
        }
    }
} 